package com.scsj.supermarket.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.scsj.supermarket.R;
import com.scsj.supermarket.bean.homebean.HomeRecommendBean;

import java.util.List;

import static com.scsj.supermarket.R.id.icon_iv;

/**
 * 首页限时抢购
 */

public class IndexLimitRobAdapter extends BaseQuickAdapter<HomeRecommendBean, BaseViewHolder> {
    public IndexLimitRobAdapter(List data) {
        super(R.layout.item_index_limit_rob_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeRecommendBean item) {
        helper.setText(R.id.title_tv, item.getName());
        helper.setText(R.id.content_tv, item.getPrice());
        Glide.with(mContext).load(item.getIcon()).into((ImageView) helper.getView(icon_iv));
    }
}
